Option Explicit

' Check arguments
If WScript.Arguments.Count < 2 Then
    WScript.Echo "Usage: cscript gentransform.vbs [english MSI] [translated MSI] [translation MST]"
    WScript.Quit(1)
End If

' Connect to Windows Installer object
Dim installer : Set installer = Nothing
Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
' Open databases
Dim Database1 : Set Database1 = installer.OpenDatabase(Wscript.Arguments(0), 0)
Dim Database2 : Set Database2 = installer.OpenDatabase(Wscript.Arguments(1), 0)
' Generate transform
Dim transform : transform = Database2.GenerateTransform(Database1,Wscript.Arguments(2))
' Create and add Summary Information
Dim transinfo : transinfo = Database2.CreateTransformSummaryInfo(Database1, WScript.Arguments(2),0,0)
